<script setup>
import { ref, onMounted, watch } from "vue";
import { useRoute, useRouter } from "vue-router";
import leftNav from "@/components/left-nav.vue"; //左侧导航

const route = useRoute();
const router = useRouter();

watch(
  () => route.path,
  (newRoute) => {
    let token = window.sessionStorage.getItem("token");
    if (!token) {
      router.push("/404");
    }
  }
);
</script>

<template>
  <div class="human-activities">
    <left-nav></left-nav>
    <div class="ha-box">
      <router-view />
    </div>
  </div>
</template>

<style scoped>
.human-activities {
  width: 100%;
  height: 100%;
  display: flex;
}

.ha-box {
  width: calc(100% - 160px);
  height: 100%;
  padding: 16px;
  background-color: #f5f7fa;
  overflow: hidden;
}

.ha-box > div {
  width: 100%;
  height: 100%;
  background-color: #fff;
  position: relative;
}
</style>
